﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2021_6_4
{

    //NPC类 实现石头剪刀布
    class NPC : IJanKenPunch_
    {
        private string npcName;

        public string NpcName { get => npcName; set => npcName = value; }

        public janKenPunch npcAction;

        public NPC(string name)
        {
            this.NpcName = name;
        }

        /// <summary>
        /// 随机出拳、剪、布
        /// </summary>
        /// <returns>枚举</returns>
        public janKenPunch DoJanKenPunch()
        {
            Random r = new Random();
            int id = r.Next(1,3);
            npcAction = (janKenPunch)id;
            return (janKenPunch)id;
        }

        public janKenPunch DoJanKenPunch(int key)
        {
            throw new NotImplementedException();
        }
        public override string ToString()
        {
            return $"{NpcName}:{npcAction}";
        }
    }
}
